import type { Address, MedicalOrderDetail, MedicineOrderParams, OrderPre } from '@/types/order'
import { request } from '@/utils/request'

/**
 * 收货地址列表
 */
export const addressListApi = () => {
  return request<Address[]>('/patient/order/address')
}
/**
 * 药品预付订单
 */
export const getPatientMedicineOrderPre = (prescriptionId: string) => {
  return request<OrderPre>('/patient/medicine/order/pre', 'GET', { prescriptionId })
}
// 药品订单-根据处方下药品订单
// POST
// /patient/medicine/order
export const getPatientMedicineOrder = (data: MedicineOrderParams) => {
  return request<{ id: string }>('/patient/medicine/order', 'POST', data)
}
/**
 * 获取药品订单详情
 * @param id 订单id
 * @returns
 */
export const getMedicalOrderDetail = (id: string) => {
  return request<MedicalOrderDetail>(`/patient/medicine/order/detail/${id}`)
}
